
package ${packageName};

<#list imports as import>
import ${import};
</#list>
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;


 /**
 * @version V1.0
 * ${sourceTableDesc}:${sourceTable} 对应实体类.
 * @ClassName: ${underlineToCamel(sourceTable?lower_case,true?string)}
 * @Description: ${sourceTableDesc}:${sourceTable} 对应实体类.
 * @author: ${author}
 * @date:   ${.now}
 * @Copyright: Copyright (c) ${.now?string('yyyy')}
 */
<#if dataBaseType == 'MYSQL'>
@TableName("`${sourceTable}`")
<#elseif dataBaseType == 'SQLSERVER'>
@TableName("[${sourceTable}]")
<#else >
@TableName("${sourceTable}")
</#if>
public class ${underlineToCamel(sourceTable?lower_case,true?string)}Entity extends BaseEntity {
  <#list columns as col>
  <#if col.columnName != 'tenant_id' && col.columnName != 'version' && col.columnName != 'creator' && col.columnName != 'create_time' && col.columnName != 'modifier' && col.columnName != 'modify_time' && col.columnName != 'id'>
   <#if (col.columnComment)?length gt 0>
   // ${col.columnComment}
   <#else >
   // ${col.columnName}
   </#if>
   @TableField(value = "${col.columnName}")
   <#if col.dataType?lower_case == 'date' || col.dataType?lower_case == 'datetime'>
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
   </#if>
   private ${getDataType(col.dataType)} ${underlineToCamel(col.columnName?lower_case,false?string)};
  </#if>
  </#list>

  <#list columns as col>
  <#if col.columnName != 'tenant_id' && col.columnName != 'version' && col.columnName != 'creator' && col.columnName != 'create_time' && col.columnName != 'modifier' && col.columnName != 'modify_time' && col.columnName != 'id'>
   public ${getDataType(col.dataType)} get${(col.columnName ? index_of('_') == 1) ? string (underlineToCamel(col.columnName?lower_case,false?string),underlineToCamel(col.columnName?lower_case,true?string))}(){
        return this.${underlineToCamel(col.columnName?lower_case,false?string)};
   }
   public void set${(col.columnName ? index_of('_') == 1) ? string (underlineToCamel(col.columnName?lower_case,false?string),underlineToCamel(col.columnName?lower_case,true?string))}(${getDataType(col.dataType)} ${underlineToCamel(col.columnName?lower_case,false?string)}){
        this.${underlineToCamel(col.columnName?lower_case,false?string)} = ${underlineToCamel(col.columnName?lower_case,false?string)};
   }
  </#if>
  </#list>

  public ${underlineToCamel(sourceTable?lower_case,true?string)}Entity(){
  }


  @Override
  public String toString(){
  return " ${underlineToCamel(sourceTable?lower_case,true?string)} ["
  <#list columns as col>
   <#if col_has_next && col.columnName != 'tenant_id' && col.columnName != 'version' && col.columnName != 'creator' && col.columnName != 'create_time' && col.columnName != 'modifier' && col.columnName != 'modify_time' && col.columnName != 'id'>
    +" ${underlineToCamel(col.columnName?lower_case,false?string)} = " +${underlineToCamel(col.columnName?lower_case,false?string)} +" ,"
   <#elseif col.columnName != 'tenant_id' && col.columnName != 'version' && col.columnName != 'creator' && col.columnName != 'create_time' && col.columnName != 'modifier' && col.columnName != 'modify_time' && col.columnName != 'id'>
    +" ${underlineToCamel(col.columnName?lower_case,false?string)} = " +${underlineToCamel(col.columnName?lower_case,false?string)}
   </#if>
  </#list>
  +" ]";
  }
}